package com.sks.bean.pojo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.compass.annotations.Index;
import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableProperty;
import org.compass.annotations.Store;
/**
 * HouseType entity. @author MyEclipse Persistence Tools
 */
@Entity(name="house_type")
@Searchable(root=false)
@JsonIgnoreProperties(value={"hibernateLazyInitializer"})  
public class HouseType implements Serializable {
	
	private static final long serialVersionUID = 8106351120886053881L;

	private Integer houseTypeId;
	private String name;
	
	public HouseType() {
	}

	public HouseType(String name) {
		this.name = name;
	}
	
	public HouseType(Integer houseTypeId, String name) {
		this.houseTypeId = houseTypeId;
		this.name = name;
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@SearchableProperty(index=Index.NO,store=Store.YES)
	public Integer getHouseTypeId() {
		return this.houseTypeId;
	}

	public void setHouseTypeId(Integer houseTypeId) {
		this.houseTypeId = houseTypeId;
	}
	
	@Column(length=32,nullable=false)
	@SearchableProperty(index=Index.NOT_ANALYZED,store=Store.YES,name="typeName")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((houseTypeId == null) ? 0 : houseTypeId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final HouseType other = (HouseType) obj;
		if (houseTypeId == null) {
			if (other.houseTypeId != null)
				return false;
		} else if (!houseTypeId.equals(other.houseTypeId))
			return false;
		return true;
	}

}